<%@ page import="sys.Student" %>
<%@ page import="sys.UsersDao" %><%--
  Created by IntelliJ IDEA.
  User: SeRein
  Date: 2021/4/9
  Time: 16:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //接收注册的用户名和密码
    Student stu = new Student();
    UsersDao dao = new UsersDao();

    stu.setUserName(request.getParameter("username"));
    stu.setPassWord(request.getParameter("password"));
    //将用户名和密码添加进数据库

    boolean bl = dao.addTo(stu);

    if(bl==true)
    {
        response.sendRedirect("login.jsp");
    }
    else
    {
        response.sendRedirect("register.jsp");
    }
%>
